package com.zyl.blog.common.domain.related.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigInteger;
import java.time.LocalDateTime;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog_Server
 * @Package: com.zyl.blog.common.domain.related.bean
 * @ClassName: UserRole
 * @Description: 用户角色关联实体
 * @Author FinalFantasy
 * @Date 2025/9/4-08:41
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("blog_user_role")
public class UserRole implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    /** 主键 */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonProperty("id")
    private BigInteger id;

    /** 用户ID */
    @TableField("user_id")
    @JsonProperty("userId")
    private BigInteger userId;

    /** 角色ID */
    @TableField("role_id")
    @JsonProperty("roleId")
    private BigInteger roleId;

    /** 创建时间 */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "createTime", access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime createTime;
}
